import pymysql


sql_connector = {
    "host": "localhost",
    "username": "root",
    "password": "Mpp19940410",
    "dbname": "RssHub"
}

data_source = []

#存放对应的数据源URL
db = pymysql.connect(sql_connector["host"], sql_connector["username"],
                     sql_connector["password"], sql_connector["dbname"])

cursor = db.cursor()
try:
    cursor.execute("select * from Station")
    results = cursor.fetchall()
    for item in results:
        data_source.append({"name": item["station_name"], "url": item["station_url"]})
except:
    db.rollback()

# data_source = [
#     {"name": "机核网资讯", "url": "https://rsshub.app/gcores/category/news"},
#     {"name": "v2ex最热", "url": "https://rsshub.app/v2ex/topics/latest"},
#     {"name": "VGTime", "url": "https://rsshub.app/vgtime/news"},
#     {"name": "游民星空", "url": "https://rsshub.app/gamersky/news"},
#     {"name": "小黑盒", "url": "https://rsshub.app/xiaoheihe/news"},
#     {"name": "掘金沸点", "url": "https://rsshub.app/juejin/pins"},
#     {"name": "微博热搜", "url": "https://rsshub.app/weibo/search/hot"},
#     {"name": "盗月社食遇记", "url": "https://rsshub.app/bilibili/user/video/99157282"},
#     {"name": "华农兄弟", "url": "https://rsshub.app/bilibili/user/video/250858633"},
#     {"name": "回形针PaperClip", "url": "https://rsshub.app/bilibili/user/video/258150656"},
#     {"name": "TESTV", "url": "https://rsshub.app/bilibili/user/video/11336264"},
#     {"name": "怕上火暴王老菊", "url": "https://rsshub.app/bilibili/user/video/423895"},
#     {"name": "野食小哥", "url": "https://rsshub.app/bilibili/user/video/30643878"},
#     {"name": "黑桐谷歌", "url": "https://rsshub.app/bilibili/user/video/43536"},
# ]


